#include <iostream>
#include <cstring>

using namespace std;

const int maxn = 1010;

int change(char c) {
	if (c >= '0' && c <= '9') return c - '0';
	if (c >= 'a' && c <= 'z') return c - 'a' + 10;
	if (c >= 'A' && c <= 'Z') return c - 'A' + 36;
	return 0;
}

int main() {
	char whole[maxn], target[maxn];
	int hash_table[80] = {0}, miss = 0;
	cin.getline(whole, maxn);
	cin.getline(target, maxn);
	int whole_len = strlen(whole);
	int target_len = strlen(target);

	for (int i = 0; i < whole_len; i++) {
		int id = change(whole[i]);
		hash_table[id]++;
	}
	for (int i = 0; i < target_len; i++) {
		int id = change(target[i]);
		hash_table[id]--;
		if (hash_table[id] < 0) {
			miss++;	
		}
	}

	if (miss > 0) {
		printf("No %d\n", miss);
	} else {
		printf("Yes %d\n", whole_len-target_len);
	}

	return 0;
}

